<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/basproject/basicdata/Bas_StationConfig.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/basproject/basicdata/Bas_StationConfig.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name:'Bas_StationConfig',
        setup() {
            const table = ref({
                key: "StationId",
                footer: "Foots",
                cnName: "工位信息",
                name: "basicdata/Bas_StationConfig",
                newTabEdit: false,
                url: "/Bas_StationConfig/",
                sortName: "StationId"
            });
            const editFormFields = ref({"PlantId":"","WorkshopId":"","LineId":"","StationCode":"","StationName":"","StationDesc":"","Enabled":"","Remarks":""});
            const editFormOptions = ref([[{"dataKey":"BASE_Plant","data":[],"title":"工厂ID","field":"PlantId","type":"select"}],
                              [{"dataKey":"BASE_Workshop","data":[],"title":"车间ID","field":"WorkshopId","type":"select"}],
                              [{"dataKey":"BASE_Line","data":[],"title":"线体Id","field":"LineId","type":"select"}],
                              [{"title":"工位代码","required":true,"field":"StationCode"}],
                              [{"title":"工位名称","required":true,"field":"StationName"}],
                              [{"title":"工位描述","field":"StationDesc"}],
                              [{"dataKey":"enabled","data":[],"title":"启用","field":"Enabled","type":"switch"}],
                              [{"title":"备注","field":"Remarks","colSize":12,"type":"textarea"}]]);
            const searchFormFields = ref({"StationName":"","PlantId":"","LineId":"","WorkshopId":""});
            const searchFormOptions = ref([[{"title":"工位名称","field":"StationName","type":"like"},{"dataKey":"BASE_Plant","data":[],"title":"工厂ID","field":"PlantId","type":"select"},{"dataKey":"BASE_Line","data":[],"title":"线体Id","field":"LineId","type":"select"},{"dataKey":"BASE_Workshop","data":[],"title":"车间ID","field":"WorkshopId","type":"select"}]]);
            const columns = ref([{field:"StationCode",title:"工位代码",type:"string",link:true,sort:true,width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"StationName",title:"工位名称",type:"string",sort:true,width:150,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"StationId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Plant.PlantCode",title:"工厂代码",type:"string",width:100,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Plant.PlantName",title:"工厂名称",type:"string",width:120,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Workshop.WorkshopCode",title:"车间代码",type:"string",width:100,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Workshop.WorkshopName",title:"车间名称",type:"string",width:120,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Line.LineCode",title:"线体编码",type:"string",width:100,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Line.LineName",title:"线体名称",type:"string",width:120,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"StationDesc",title:"工位描述",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"启用",type:"sbyte",bind:{ key:"enabled",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"PlantId",title:"工厂ID",type:"bigint",bind:{ key:"BASE_Plant",data:[]},width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"LineId",title:"线体Id",type:"bigint",bind:{ key:"BASE_Line",data:[]},width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"WorkshopId",title:"车间ID",type:"bigint",bind:{ key:"BASE_Workshop",data:[]},width:120,hidden:true,showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
